//
//  LocalEventsListViewController.h
//  StanfordEvents
//
//  Created by Gongmyung on 7/14/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//


#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import "Event.h"
#import "PublishEventTableViewController.h"
#import "EventDetailTableViewController.h"
#import "ASIFormDataRequest.h"
#import "JSON.h"

@class StanfordEventsAppDelegate;

@interface LocalEventsListViewController : UITableViewController <CLLocationManagerDelegate, EventDetailViewDelegate> {
    NSMutableArray *eventsArray;
    NSManagedObjectContext *managedObjectContext;
    UIBarButtonItem *refreshButton;
    
    CLLocationManager *locationManager;
    //this is used the first time this view loads to indicate that we need to refresh the events from the server
    bool needsRefresh;
    
    //this is used for filters
    bool needsUpdate;
}

- (id)initWithStyle:(UITableViewStyle)style withEvents:(NSMutableArray *)events;

- (void)downloadFinished:(NSString*)eventsToParse;

- (void)addEvent:(Event*)toAdd;

- (void)updateFilters;

@property (nonatomic, retain) NSMutableArray *eventsArray;
@property (nonatomic, retain) NSManagedObjectContext *managedObjectContext;
@property (nonatomic, retain) CLLocationManager *locationManager;
@property (nonatomic, assign) bool needsUpdate;
@end
